//
//  VipPrivTopCell.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/10.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit
import SDWebImage

class VipPrivTopCell: BaseTableViewCell {
    
    @IBOutlet weak var btn: UIButton!
    
    @IBOutlet weak var middleImageView: UIImageView!
    
    @IBOutlet weak var beanTopLabel: UILabel!

    @IBOutlet weak var beanBottomLabel: UILabel!
    
    @IBOutlet weak var goldTopLabel: UILabel!
    
    @IBOutlet weak var goldBottomLabel: UILabel!
    
    @IBOutlet weak var nikNameLabel: UILabel!
    
    @IBOutlet weak var verifiLabel: UILabel!
    
    
    var model : VipPrivilegeModel?{
        
        didSet{
            
            if model == nil {
                return
            }
            
            beanTopLabel.text = model?.bean
            
            goldTopLabel.text = model?.gold
            
            nikNameLabel.text = model?.nickname
            
            middleImageView.sd_setImage(with: URL(string :model!.avator), placeholderImage: UIImage.defaulImage(), options: []) { (image, _, _, _) in}
            
            if model!.can_authentic == "1" {
                verifiLabel.text = "未认证"
            } else {
                verifiLabel.text = "已认证"

            }

            
        }
        
        
    }
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        contentView.backgroundColor = UIColor.viewBgGrey()
        middleImageView.addCornerAndBorder(borderColor: UIColor.colorWithA(r: 255, g: 255, b: 255, A: 0.75), borderWidth: 5, masksToBounds: true, cornerRadius: 50)

        // Initialization code
    }

    @IBAction func btnDidTop(_ sender: UIButton) {
        
        viewController().navigationController?.popViewController(animated: true)
    }
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
